<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Dreamview</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script>
      loadJSON('parameters.json', (response) => {
        window.PARAMETERS = JSON.parse(response);
      });
      function loadJSON(jsonFilePath, callback) {
        console.log("Loading Json file:", jsonFilePath);
        const xobj = new XMLHttpRequest();
        xobj.overrideMimeType('application/json');
        xobj.open('GET', jsonFilePath, false /* synchronous */);
        xobj.onreadystatechange = () => {
          if (xobj.readyState === 4 && xobj.status === 200) {
            // Required use of an anonymous callback as .open will NOT
            // return a value but simply returns undefined in asynchronous mode
            callback(xobj.responseText);
          }
        };
        xobj.send(null);
      }
    </script>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>
